#ifndef _ESP32ADC_H_
#define _ESP32ADC_H_

#include "driver/adc.h"
#include "esp_adc_cal.h"

typedef enum 
{
 ESP_ADC1=0,
 ESP_ADC2,
}ADCx;




typedef struct{
    int rawRow;
    int rawLine;

    int row_mid;
    int line_mid;

    float rowRange;
    float lineRange;

    float rowPersent;
    float linePersent;

    float RowZero;
    float lineZero;

    float rowRef;
    float lineRef;

    int row_move_cnt;
    int line_move_cnt;

    char rowMove;
    char lineMove;

}Js_Param;

extern Js_Param JsParam;


void adc1_init(char channel);

void adc2_init(char channel);

int adc_read(char channel, ADCx adc_x);


void JoyStick_task(void *arg);
#endif